﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace Neo4jRestSharp
{
    public class RootNode : Node
    {
        protected override void ParseJson()
        {
			Debug.Assert(nodeObjectServices != null);

			//get uri and id
            this.selfUri = new Uri(jsonObj["reference node"].Value<string>());
			string nodeIdStr = this.selfUri.Segments[this.selfUri.Segments.Length - 1];
            nodeId = int.Parse(nodeIdStr);

			//set data properties
			foreach (var prop in jsonObj)
			{
				this.SetProperty(prop.Key, prop.Value.Value<string>());
			}
        }
       
        public string Index
        {
            get { return jsonObj["index"].Value<string>(); }            
        }

        public string Uri
        {
            get { return jsonObj["reference node"].Value<string>(); }
        }
    }
}
